from flask import Flask, jsonify
from flask_cors import CORS
from analyse.analyse import *

app = Flask(__name__)
CORS(app, resources=r'/*')


@app.route('/')
def hello_world():
    return 'Hello World!'


@app.route('/map',methods=['POST'])
def map_guang_dong():
    return jsonify(map_data())


@app.route('/radar',methods=['POST'])
def radar():
    return jsonify(radar_data())


@app.route('/bar',methods=['POST'])
def bar():
    return jsonify(heat_top10())


@app.route('/scatter',methods=['POST'])
def scatter():
    return jsonify(scatter_data())

@app.route('/wordCloud',methods=['POST'])
def word_cloud():
    return jsonify(comment_word_frequency_top50())


if __name__ == '__main__':
    app.run()
